center input element css

34

input {
text-align: center;
}
<html>
<head>
    <style>
        div.wrapper {
            width: 300px;
            height:300px;
            border:1px solid black;
        }

        input[type="range"] {
             display: block;
             margin : 0 auto;
        }

    </style>
</head>
<body>

    <div class='wrapper'>
        <input type='range' name='1-10' value='5' min='1' max='2' />
    </div>    


</body>
</html>

Comments

Submit
0 Comments